package com.coke.demo.service.impl;

import com.coke.demo.mapper.CourseTimeMapper;
import com.coke.demo.service.CourseTimeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 19602
 */
@Service
public class CourseTimeServiceImpl implements CourseTimeService {

    private CourseTimeMapper courseTimeMapper;

    @Autowired
    public void setOpenTimeMapper(CourseTimeMapper courseTimeMapper) {
        this.courseTimeMapper = courseTimeMapper;
    }

    /**
     * 根据实验室id查询实验室每天具体开放时间
     *
     * @param labId 实验室id
     * @return Time
     */
    @Override
    public List<String> findTimeByLabId(Integer labId) {
        return courseTimeMapper.findTimeByLabId(labId);
    }

    /**
     * 根据日期查询全部信息
     *
     * @param day  周一 至 周日
     * @param time 上课时间
     * @return List<String>
     */
    @Override
    public List<String> findLabNameByTime(Integer day, String time) {
        return courseTimeMapper.findLabNameByTime(day, time);
    }
}
